import type { PageResult } from '@/types/global'
import type { ReservationPageParams, ReservationItem, ReservationRequest, ReservationStatus } from '@/types/reservation'
import { http } from '@/utils/http'

// 获取数据
export const getReservationListApi = (data?: ReservationPageParams) => {
  return http<PageResult<ReservationItem>>({
    method: 'GET',
    url: '/admin/barcodeDueApi/reservationBarcodePage',
    data,
  })
}

// 提交数据
export const postReservationApi = (data?: ReservationRequest) => {
  return http({
    method: 'POST',
    url: '/admin/barcodeDueApi/reservationBarcode',
    data,
  })
}

// 修改状态
export const putReservationApi = (data: ReservationStatus) => {
  return http({
    method: 'POST',
    url: `/admin/barcodeDueApi/updateReservationBarcodeStatus`,
    data,
  })
}
